package com.itheima.bigevent.pojo;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonView;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @TableName category
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Category implements Serializable {
    @NotNull(groups = {Update.class})
    private Integer id;

    @NotEmpty
    private String categoryName;


    @NotEmpty
    private String categoryAlias;

    @JsonIgnore()
    private Integer createUser;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public interface Add extends Default{

    }

    public interface Update extends Default{

    }

    /**
     * 1.如果注解前没有写groups, 那么就属于默认组Default
     * 2.可以通过extends继承其他组
     */
}